<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>homework1</title>
</head>
<body>
<pre>
import math
s = input()
i = 0
j = 0
s = s.split(" ")
while s[0] !='STOP':
    if s[0] == 'UP':
        i =i+int(s[1])
    elif s[0] == 'DOWN':
        i = i -int(s[1])
    elif s[0] == 'RIGHT':
        j = j+int(s[1])
    elif s[0] == 'LEFT':
        j = j-int(s[1])
    else:
        pass
    s = input()
    s = s.split(" ")
l = math.sqrt(math.pow(i,2)+math.pow(j,2))
print("距离原点：",round(l))
</pre>
</body>
</html>